package com.nf.practice.stringtest;

import org.junit.jupiter.api.Test;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

public class Split {

    @Test
    public void test2() {
        String idCard = "30010019990101123X";
        String result = idCard.replaceAll("(?<=\\w{6})\\w(?=\\w{4})", "*");
        System.out.println("脱敏的身份证号：" + result);
    }

    @Test
    public void test1() {
//        String configStr = "101,103,106,102,109";
        String configStr = "101";
        String[] configArr = configStr.split(",");
        List<String> configList = Arrays.asList(configArr);

//        List<String> configList = new ArrayList<>();
//        for (String config : configArr) {
//            configList.add(config);
//        }
        System.out.println("configList = " + configList);
    }

}
